<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <meta name="renderer" content="webkit">
    <title></title>  
    <link rel="stylesheet" href="css/pintuer.css">
    <link rel="stylesheet" href="css/admin.css">
    <script src="js/jquery.js"></script>
    <script src="js/pintuer.js"></script>  
</head>

<body>
  <div class="panel admin-panel">
    <div class="panel-head"><strong class="icon-search"> 查询航线信息</strong></div>
    <div class="padding border-bottom">
      <ul class="search">
        <li>
           <div  class="field">
          <input type="text" class="input w50" placeholder="输入航线编号" size=100 id="rno" /> 
        </div>
          <button id="sbtn" class="button border-green" ><span class="icon-search"></span> 搜索</button>
        </li>
      </ul>
    </div>
    <table class="table table-hover text-center">   
    </table>
  </div>
</body>
<script>
$(function() {
     get("");
 });
 $("#sbtn").on("click",function(){
     var value = $("#rno").val();
     get(value);
 });
 function get(value){
     $.ajax({
      url:"SelectRoute",
      type:"POST",
      data:{"route.rno":value},
      success: function(data)
      {
      var html ="<tr><th>航线编号</th> <th>航线类型</th><th>游轮名称</th><th>途径城市</th><th>启程时间</th><th>结束时间</th><th>旅程简介</th><th>旅程定价</th><th>航线状态</th></tr>";
      if(data == null){
          $(".table").html(html);
          return ;
      }
      var routes = JSON.parse(data);
      for(var i=0;i<routes.length;i++){    
             html +="<tr><td>"+routes[i].rno+"</td><td>"+routes[i].rpattern+"</td><td>"+routes[i].rbname+"</td><td>"+routes[i].rcity+"</td><td>"+routes[i].rstime+"</td><td>"+routes[i].retime+"</td><td>"+routes[i].rintroduction+"</td><td>"+routes[i].rprice+"</td><td>"+routes[i].rstate+"</td></tr>";
              }     
       $(".table").html(html);      
      }
      });
 }
</script>
</html>
